package com.atcc.test.domain;

import java.io.Serializable;

public class Result<T> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 558108025203849205L;

	/**
	 * 返回的信息
	 */
	private String message;

	/**
	 * 返回的状态码
	 */
	private Integer code;

	/**
	 * 返回的数据
	 */
	private T data;

	public Result(ResultCode resultCode, T data) {
		this.message = resultCode.getMessage();
		this.code = resultCode.getCode();
		this.data = data;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "Result [message=" + message + ", code=" + code + ", data=" + data + "]";
	}

}
